home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / txmgr / nsITransactionManager.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  14KB  |  369 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsITransactionManager.idl
  3.  */
  4.  
  5. #ifndef __gen_nsITransactionManager_h__
  6. #define __gen_nsITransactionManager_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsITransaction_h__
  14. #include "nsITransaction.h"
  15. #endif
  16.  
  17. #ifndef __gen_nsITransactionList_h__
  18. #include "nsITransactionList.h"
  19. #endif
  20.  
  21. #ifndef __gen_nsITransactionListener_h__
  22. #include "nsITransactionListener.h"
  23. #endif
  24.  
  25. /* For IDL files that don't want to include root IDL files. */
  26. #ifndef NS_NO_VTABLE
  27. #define NS_NO_VTABLE
  28. #endif
  29. #define NS_TRANSACTIONMANAGER_CONTRACTID "@mozilla.org/transactionmanager;1"
  30.  
  31. /* starting interface:    nsITransactionManager */
  32. #define NS_ITRANSACTIONMANAGER_IID_STR "58e330c2-7b48-11d2-98b9-00805f297d89"
  33.  
  34. #define NS_ITRANSACTIONMANAGER_IID \
  35.   {0x58e330c2, 0x7b48, 0x11d2, \
  36.     { 0x98, 0xb9, 0x00, 0x80, 0x5f, 0x29, 0x7d, 0x89 }}
  37.  
  38. class NS_NO_VTABLE nsITransactionManager : public nsISupports {
  39.  public: 
  40.  
  41.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITRANSACTIONMANAGER_IID)
  42.  
  43.   /**
  44.  * The nsITransactionManager interface.
  45.  * <P>
  46.  * This interface is implemented by an object that wants to
  47.  * manage/track transactions.
  48.  */
  49. /**
  50.    * Calls a transaction's doTransaction() method, then pushes it on the
  51.    * undo stack.
  52.    * <P>
  53.    * This method calls the transaction's AddRef() method.
  54.    * The transaction's Release() method will be called when the undo or redo
  55.    * stack is pruned or when the transaction manager is destroyed.
  56.    * @param aTransaction the transaction to do.
  57.    */
  58.   /* void doTransaction (in nsITransaction aTransaction); */
  59.   NS_IMETHOD DoTransaction(nsITransaction *aTransaction) = 0;
  60.  
  61.   /**
  62.    * Pops the topmost transaction on the undo stack, calls it's
  63.    * undoTransaction() method, then pushes it on the redo stack.
  64.    */
  65.   /* void undoTransaction (); */
  66.   NS_IMETHOD UndoTransaction(void) = 0;
  67.  
  68.   /**
  69.    * Pops the topmost transaction on the redo stack, calls it's
  70.    * redoTransaction() method, then pushes it on the undo stack.
  71.    */
  72.   /* void redoTransaction (); */
  73.   NS_IMETHOD RedoTransaction(void) = 0;
  74.  
  75.   /**
  76.    * Clears the undo and redo stacks.
  77.    */
  78.   /* void clear (); */
  79.   NS_IMETHOD Clear(void) = 0;
  80.  
  81.   /**
  82.    * Turns on the transaction manager's batch mode, forcing all transactions
  83.    * executed by the transaction manager's doTransaction() method to be
  84.    * aggregated together until EndBatch() is called.  This mode allows an
  85.    * application to execute and group together several independent transactions
  86.    * so they can be undone with a single call to undoTransaction().
  87.    */
  88.   /* void beginBatch (); */
  89.   NS_IMETHOD BeginBatch(void) = 0;
  90.  
  91.   /**
  92.    * Turns off the transaction manager's batch mode.
  93.    */
  94.   /* void endBatch (); */
  95.   NS_IMETHOD EndBatch(void) = 0;
  96.  
  97.   /**
  98.    * The number of items on the undo stack.
  99.    */
  100.   /* readonly attribute long numberOfUndoItems; */
  101.   NS_IMETHOD GetNumberOfUndoItems(PRInt32 *aNumberOfUndoItems) = 0;
  102.  
  103.   /**
  104.    * The number of items on the redo stack.
  105.    */
  106.   /* readonly attribute long numberOfRedoItems; */
  107.   NS_IMETHOD GetNumberOfRedoItems(PRInt32 *aNumberOfRedoItems) = 0;
  108.  
  109.   /**
  110.    * Sets the maximum number of transaction items the transaction manager will
  111.    * maintain at any time. This is commonly referred to as the number of levels
  112.    * of undo.
  113.    * @param aMaxCount A value of -1 means no limit. A value of zero means the
  114.    * transaction manager will execute each transaction, then immediately release
  115.    * all references it has to the transaction without pushing it on the undo
  116.    * stack. A value greater than zero indicates the max number of transactions
  117.    * that can exist at any time on both the undo and redo stacks. This method
  118.    * will prune the necessary number of transactions on the undo and redo
  119.    * stacks if the value specified is less than the number of items that exist
  120.    * on both the undo and redo stacks.
  121.    */
  122.   /* attribute long maxTransactionCount; */
  123.   NS_IMETHOD GetMaxTransactionCount(PRInt32 *aMaxTransactionCount) = 0;
  124.   NS_IMETHOD SetMaxTransactionCount(PRInt32 aMaxTransactionCount) = 0;
  125.  
  126.   /**
  127.    * Returns an AddRef'd pointer to the transaction at the top of the
  128.    * undo stack. Callers should be aware that this method could return
  129.    * return a null in some implementations if there is a batch at the top
  130.    * of the undo stack.
  131.    */
  132.   /* nsITransaction peekUndoStack (); */
  133.   NS_IMETHOD PeekUndoStack(nsITransaction **_retval) = 0;
  134.  
  135.   /**
  136.    * Returns an AddRef'd pointer to the transaction at the top of the
  137.    * redo stack. Callers should be aware that this method could return
  138.    * return a null in some implementations if there is a batch at the top
  139.    * of the redo stack.
  140.    */
  141.   /* nsITransaction peekRedoStack (); */
  142.   NS_IMETHOD PeekRedoStack(nsITransaction **_retval) = 0;
  143.  
  144.   /**
  145.    * Returns the list of transactions on the undo stack. Note that the
  146.    * transaction at the top of the undo stack will actually be at the
  147.    * index 'n-1' in the list, where 'n' is the number of items in the list.
  148.    */
  149.   /* nsITransactionList getUndoList (); */
  150.   NS_IMETHOD GetUndoList(nsITransactionList **_retval) = 0;
  151.  
  152.   /**
  153.    * Returns the list of transactions on the redo stack. Note that the
  154.    * transaction at the top of the redo stack will actually be at the
  155.    * index 'n-1' in the list, where 'n' is the number of items in the list.
  156.    */
  157.   /* nsITransactionList getRedoList (); */
  158.   NS_IMETHOD GetRedoList(nsITransactionList **_retval) = 0;
  159.  
  160.   /**
  161.    * Adds a listener to the transaction manager's notification list. Listeners
  162.    * are notified whenever a transaction is done, undone, or redone.
  163.    * <P>
  164.    * The listener's AddRef() method is called.
  165.    * @param aListener the lister to add.
  166.    */
  167.   /* void AddListener (in nsITransactionListener aListener); */
  168.   NS_IMETHOD AddListener(nsITransactionListener *aListener) = 0;
  169.  
  170.   /**
  171.    * Removes a listener from the transaction manager's notification list.
  172.    * <P>
  173.    * The listener's Release() method is called.
  174.    * @param aListener the lister to remove.
  175.    */
  176.   /* void RemoveListener (in nsITransactionListener aListener); */
  177.   NS_IMETHOD RemoveListener(nsITransactionListener *aListener) = 0;
  178.  
  179. };
  180.  
  181. /* Use this macro when declaring classes that implement this interface. */
  182. #define NS_DECL_NSITRANSACTIONMANAGER \
  183.   NS_IMETHOD DoTransaction(nsITransaction *aTransaction); \
  184.   NS_IMETHOD UndoTransaction(void); \
  185.   NS_IMETHOD RedoTransaction(void); \
  186.   NS_IMETHOD Clear(void); \
  187.   NS_IMETHOD BeginBatch(void); \
  188.   NS_IMETHOD EndBatch(void); \
  189.   NS_IMETHOD GetNumberOfUndoItems(PRInt32 *aNumberOfUndoItems); \
  190.   NS_IMETHOD GetNumberOfRedoItems(PRInt32 *aNumberOfRedoItems); \
  191.   NS_IMETHOD GetMaxTransactionCount(PRInt32 *aMaxTransactionCount); \
  192.   NS_IMETHOD SetMaxTransactionCount(PRInt32 aMaxTransactionCount); \
  193.   NS_IMETHOD PeekUndoStack(nsITransaction **_retval); \
  194.   NS_IMETHOD PeekRedoStack(nsITransaction **_retval); \
  195.   NS_IMETHOD GetUndoList(nsITransactionList **_retval); \
  196.   NS_IMETHOD GetRedoList(nsITransactionList **_retval); \
  197.   NS_IMETHOD AddListener(nsITransactionListener *aListener); \
  198.   NS_IMETHOD RemoveListener(nsITransactionListener *aListener); 
  199.  
  200. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  201. #define NS_FORWARD_NSITRANSACTIONMANAGER(_to) \
  202.   NS_IMETHOD DoTransaction(nsITransaction *aTransaction) { return _to DoTransaction(aTransaction); } \
  203.   NS_IMETHOD UndoTransaction(void) { return _to UndoTransaction(); } \
  204.   NS_IMETHOD RedoTransaction(void) { return _to RedoTransaction(); } \
  205.   NS_IMETHOD Clear(void) { return _to Clear(); } \
  206.   NS_IMETHOD BeginBatch(void) { return _to BeginBatch(); } \
  207.   NS_IMETHOD EndBatch(void) { return _to EndBatch(); } \
  208.   NS_IMETHOD GetNumberOfUndoItems(PRInt32 *aNumberOfUndoItems) { return _to GetNumberOfUndoItems(aNumberOfUndoItems); } \
  209.   NS_IMETHOD GetNumberOfRedoItems(PRInt32 *aNumberOfRedoItems) { return _to GetNumberOfRedoItems(aNumberOfRedoItems); } \
  210.   NS_IMETHOD GetMaxTransactionCount(PRInt32 *aMaxTransactionCount) { return _to GetMaxTransactionCount(aMaxTransactionCount); } \
  211.   NS_IMETHOD SetMaxTransactionCount(PRInt32 aMaxTransactionCount) { return _to SetMaxTransactionCount(aMaxTransactionCount); } \
  212.   NS_IMETHOD PeekUndoStack(nsITransaction **_retval) { return _to PeekUndoStack(_retval); } \
  213.   NS_IMETHOD PeekRedoStack(nsITransaction **_retval) { return _to PeekRedoStack(_retval); } \
  214.   NS_IMETHOD GetUndoList(nsITransactionList **_retval) { return _to GetUndoList(_retval); } \
  215.   NS_IMETHOD GetRedoList(nsITransactionList **_retval) { return _to GetRedoList(_retval); } \
  216.   NS_IMETHOD AddListener(nsITransactionListener *aListener) { return _to AddListener(aListener); } \
  217.   NS_IMETHOD RemoveListener(nsITransactionListener *aListener) { return _to RemoveListener(aListener); } 
  218.  
  219. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  220. #define NS_FORWARD_SAFE_NSITRANSACTIONMANAGER(_to) \
  221.   NS_IMETHOD DoTransaction(nsITransaction *aTransaction) { return !_to ? NS_ERROR_NULL_POINTER : _to->DoTransaction(aTransaction); } \
  222.   NS_IMETHOD UndoTransaction(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->UndoTransaction(); } \
  223.   NS_IMETHOD RedoTransaction(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->RedoTransaction(); } \
  224.   NS_IMETHOD Clear(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Clear(); } \
  225.   NS_IMETHOD BeginBatch(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->BeginBatch(); } \
  226.   NS_IMETHOD EndBatch(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->EndBatch(); } \
  227.   NS_IMETHOD GetNumberOfUndoItems(PRInt32 *aNumberOfUndoItems) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNumberOfUndoItems(aNumberOfUndoItems); } \
  228.   NS_IMETHOD GetNumberOfRedoItems(PRInt32 *aNumberOfRedoItems) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNumberOfRedoItems(aNumberOfRedoItems); } \
  229.   NS_IMETHOD GetMaxTransactionCount(PRInt32 *aMaxTransactionCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMaxTransactionCount(aMaxTransactionCount); } \
  230.   NS_IMETHOD SetMaxTransactionCount(PRInt32 aMaxTransactionCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMaxTransactionCount(aMaxTransactionCount); } \
  231.   NS_IMETHOD PeekUndoStack(nsITransaction **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->PeekUndoStack(_retval); } \
  232.   NS_IMETHOD PeekRedoStack(nsITransaction **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->PeekRedoStack(_retval); } \
  233.   NS_IMETHOD GetUndoList(nsITransactionList **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUndoList(_retval); } \
  234.   NS_IMETHOD GetRedoList(nsITransactionList **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRedoList(_retval); } \
  235.   NS_IMETHOD AddListener(nsITransactionListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddListener(aListener); } \
  236.   NS_IMETHOD RemoveListener(nsITransactionListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveListener(aListener); } 
  237.  
  238. #if 0
  239. /* Use the code below as a template for the implementation class for this interface. */
  240.  
  241. /* Header file */
  242. class nsTransactionManager : public nsITransactionManager
  243. {
  244. public:
  245.   NS_DECL_ISUPPORTS
  246.   NS_DECL_NSITRANSACTIONMANAGER
  247.  
  248.   nsTransactionManager();
  249.  
  250. private:
  251.   ~nsTransactionManager();
  252.  
  253. protected:
  254.   /* additional members */
  255. };
  256.  
  257. /* Implementation file */
  258. NS_IMPL_ISUPPORTS1(nsTransactionManager, nsITransactionManager)
  259.  
  260. nsTransactionManager::nsTransactionManager()
  261. {
  262.   /* member initializers and constructor code */
  263. }
  264.  
  265. nsTransactionManager::~nsTransactionManager()
  266. {
  267.   /* destructor code */
  268. }
  269.  
  270. /* void doTransaction (in nsITransaction aTransaction); */
  271. NS_IMETHODIMP nsTransactionManager::DoTransaction(nsITransaction *aTransaction)
  272. {
  273.     return NS_ERROR_NOT_IMPLEMENTED;
  274. }
  275.  
  276. /* void undoTransaction (); */
  277. NS_IMETHODIMP nsTransactionManager::UndoTransaction()
  278. {
  279.     return NS_ERROR_NOT_IMPLEMENTED;
  280. }
  281.  
  282. /* void redoTransaction (); */
  283. NS_IMETHODIMP nsTransactionManager::RedoTransaction()
  284. {
  285.     return NS_ERROR_NOT_IMPLEMENTED;
  286. }
  287.  
  288. /* void clear (); */
  289. NS_IMETHODIMP nsTransactionManager::Clear()
  290. {
  291.     return NS_ERROR_NOT_IMPLEMENTED;
  292. }
  293.  
  294. /* void beginBatch (); */
  295. NS_IMETHODIMP nsTransactionManager::BeginBatch()
  296. {
  297.     return NS_ERROR_NOT_IMPLEMENTED;
  298. }
  299.  
  300. /* void endBatch (); */
  301. NS_IMETHODIMP nsTransactionManager::EndBatch()
  302. {
  303.     return NS_ERROR_NOT_IMPLEMENTED;
  304. }
  305.  
  306. /* readonly attribute long numberOfUndoItems; */
  307. NS_IMETHODIMP nsTransactionManager::GetNumberOfUndoItems(PRInt32 *aNumberOfUndoItems)
  308. {
  309.     return NS_ERROR_NOT_IMPLEMENTED;
  310. }
  311.  
  312. /* readonly attribute long numberOfRedoItems; */
  313. NS_IMETHODIMP nsTransactionManager::GetNumberOfRedoItems(PRInt32 *aNumberOfRedoItems)
  314. {
  315.     return NS_ERROR_NOT_IMPLEMENTED;
  316. }
  317.  
  318. /* attribute long maxTransactionCount; */
  319. NS_IMETHODIMP nsTransactionManager::GetMaxTransactionCount(PRInt32 *aMaxTransactionCount)
  320. {
  321.     return NS_ERROR_NOT_IMPLEMENTED;
  322. }
  323. NS_IMETHODIMP nsTransactionManager::SetMaxTransactionCount(PRInt32 aMaxTransactionCount)
  324. {
  325.     return NS_ERROR_NOT_IMPLEMENTED;
  326. }
  327.  
  328. /* nsITransaction peekUndoStack (); */
  329. NS_IMETHODIMP nsTransactionManager::PeekUndoStack(nsITransaction **_retval)
  330. {
  331.     return NS_ERROR_NOT_IMPLEMENTED;
  332. }
  333.  
  334. /* nsITransaction peekRedoStack (); */
  335. NS_IMETHODIMP nsTransactionManager::PeekRedoStack(nsITransaction **_retval)
  336. {
  337.     return NS_ERROR_NOT_IMPLEMENTED;
  338. }
  339.  
  340. /* nsITransactionList getUndoList (); */
  341. NS_IMETHODIMP nsTransactionManager::GetUndoList(nsITransactionList **_retval)
  342. {
  343.     return NS_ERROR_NOT_IMPLEMENTED;
  344. }
  345.  
  346. /* nsITransactionList getRedoList (); */
  347. NS_IMETHODIMP nsTransactionManager::GetRedoList(nsITransactionList **_retval)
  348. {
  349.     return NS_ERROR_NOT_IMPLEMENTED;
  350. }
  351.  
  352. /* void AddListener (in nsITransactionListener aListener); */
  353. NS_IMETHODIMP nsTransactionManager::AddListener(nsITransactionListener *aListener)
  354. {
  355.     return NS_ERROR_NOT_IMPLEMENTED;
  356. }
  357.  
  358. /* void RemoveListener (in nsITransactionListener aListener); */
  359. NS_IMETHODIMP nsTransactionManager::RemoveListener(nsITransactionListener *aListener)
  360. {
  361.     return NS_ERROR_NOT_IMPLEMENTED;
  362. }
  363.  
  364. /* End of implementation class template. */
  365. #endif
  366.  
  367.  
  368. #endif /* __gen_nsITransactionManager_h__ */
  369.